﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using OgilvyOne.BLL;

/// <summary>
/// CMS前台访问类
/// </summary>
public class CmsContentView : BasePage
{
    public CmsContentView()
    {
        //
        //TODO: 在此处添加构造函数逻辑
        //
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            CmsVo vo = new CmsVo();
            string aid = Request.Params["aid"];
            if (aid != null && aid != "")
            {
                try
                {
                    vo.Aid = int.Parse(aid);
                }
                catch { }
            }
            string cid = Request.Params["cid"];
            if (cid != null && cid != "")
            {
                try
                {
                    vo.Cid = int.Parse(cid);
                }
                catch { }
            }
            
            string tid = Request.Params["tid"];
            if (tid != null && tid != "")
            {
                try
                {
                    vo.Tid = int.Parse(tid);
                }
                catch { }
            }
            string pagenum = Request.Params["pagenum"];
            if (pagenum != null && pagenum != "")
            {
                try
                {
                    vo.Pagenum = int.Parse(pagenum);
                }
                catch { }
            }
            string pagesize = Request.Params["pagesize"];
            if (pagesize != null && pagesize != "")
            {
                try
                {
                    vo.Pagesize = int.Parse(pagesize);
                }
                catch { }
            }
            string q = Request.Params["q"];
            if (q != null)
            {
                vo.QueryKey = q;
            }
            string layerid = Request.Params["layerid"];
            if (layerid != null && layerid != "")
            {
                vo.Layerid = layerid;
            }
            string year = Request.Params["year"];
            if (year != null && year != "")
            {
                try
                {
                    vo.Year = int.Parse(year);
                }
                catch
                {
                }
            }

            string month = Request.Params["month"];
            if (month != null && month != "")
            {
                try
                {
                    vo.Month = int.Parse(month);
                }
                catch
                {
                }
            }

            Response.Write(CmsProxy.GetHtml(vo));
            Response.End();
        }
    }
}
